package com.example.kucun.service.impl;
 
import com.example.kucun.entity.KuCun;
import com.example.kucun.mapper.KuCunMapper;
import com.example.kucun.service.KuCunService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class KuCunServiceImpl implements KuCunService {
 
    @Autowired
    private KuCunMapper kuCunMapper;
 

    @Transactional(rollbackFor = Exception.class)
    @Override
    public void update() {
        KuCun kuCun=kuCunMapper.selectById(2);
        kuCun.setCount(10);
        kuCunMapper.updateById(kuCun);
    }
}